package com.three.lab.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.three.lab.R;
import com.three.lab.bean.ActivityMsgBean;

import org.jetbrains.annotations.NotNull;

import java.util.List;

public class ActivityMsgAdapter extends BaseQuickAdapter<ActivityMsgBean, BaseViewHolder> {

    public ActivityMsgAdapter(@Nullable List<ActivityMsgBean> data) {
        super(R.layout.item_list_activity_msg,data);
    }

    public ActivityMsgAdapter() {
        super(R.layout.item_list_activity_msg);
    }

    @Override
    protected void convert(@NonNull @NotNull BaseViewHolder helper, ActivityMsgBean item) {
        helper.setText(R.id.tv_type,item.getType())
                .setText(R.id.tv_time,item.getTime())
                .setText(R.id.tv_name,item.getName())
                .setText(R.id.tv_des,item.getDes())
                .setText(R.id.tv_tips,item.getTips())
                .setGone(R.id.tv_flag,item.isEnd())
                .setTextColor(R.id.tv_type,item.isEnd() ? mContext.getResources().getColor(R.color.cor_333) : mContext.getResources().getColor(R.color.col_red))
                .setTextColor(R.id.tv_tips,item.isEnd() ? mContext.getResources().getColor(R.color.cor_333) : mContext.getResources().getColor(R.color.col_red));
    }
}
